//
//  ListCollectionViewCell.m
//  海角音乐
//
//  Created by dllo on 15/8/10.
//  Copyright (c) 2015年 杨元石. All rights reserved.
//

#import "ListCollectionViewCell.h"

@implementation ListCollectionViewCell

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        
         _imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0,0, self.contentView.frame.size.width, self.contentView.frame.size.height-35)];
        _imageView.backgroundColor = [UIColor yellowColor];
        _imageView.layer.masksToBounds = YES;
        _imageView.layer.cornerRadius = 6;
        
        
        
        CGFloat height = SCREEN_WIDTH*0.093333333; // 35
        _label = [[UILabel alloc]initWithFrame:CGRectMake(0, self.contentView.frame.size.height - height, self.contentView.frame.size.width , height)];
        _label.font = [UIFont systemFontOfSize:12];
        _label.numberOfLines = 0;
        _label.textColor = [UIColor whiteColor];
        [self.contentView addSubview:_imageView];
        [self.contentView addSubview:_label];
        
        [_imageView release];
        [_label release];


    }
    
    return self;
}

- (void)getModelForCell:(RecommedModel *)recommedModel
{
    
    [_imageView sd_setImageWithURL:[NSURL URLWithString:recommedModel.pic_url] placeholderImage:[UIImage imageNamed:@"grid_default.png"]];
    
    _label.text = recommedModel.desc;
    
}


@end
